<!doctype html>
<html>
    <head>
        <script type="module">
            import perspective from "/node_modules/@perspective-dev/client/dist/esm/perspective.js";
            let resp = await fetch("/node_modules/@perspective-dev/test/assets/superstore.csv");
            let csv = await resp.text();
            const wasm = fetch("/node_modules/@perspective-dev/client/dist/wasm/perspective-js.wasm");
            const wasm2 = fetch("/node_modules/@perspective-dev/server/dist/wasm/perspective-server.wasm");
            perspective.init_client(wasm);
            perspective.init_server(wasm2);
            const registration = await navigator.serviceWorker.register("/node_modules/@perspective-dev/client/dist/cdn/perspective-server.worker.js", {
                scope: "/node_modules/@perspective-dev/client/dist/cdn/",
            });

            const worker = await perspective.worker(registration.active);
            window.table = worker.table(csv, { index: "Row ID" });
            window.__TEST_WORKER__ = worker;
            window.__TEST_PERSPECTIVE_READY__ = true;
        </script>
    </head>
</html>
